/* 
 * Write a C++ program to illustrate
 * virtual function
 */

# include <iostream>
using namespace std;

class Father {
public:
  virtual void saySomething();
};

class Son:public Father{
public:
  void saySomething();
};

void Father::saySomething() {
  cout << "Dad: Go and study!" << endl;
}

void Son::saySomething() {
  cout << "Son: In a minute dad!" << endl;
}

int main() {
  Father father;
  Son son;
  father.saySomething();
  son.saySomething();
  return 0;
}
